<#include "/layout/layout.ftl">
<@body>
<link href="/css/toolPage.css" rel="stylesheet"/>
<link href="/lib/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet"/>
<script src="/lib/bootstrap-select/js/bootstrap-select.min.js"></script>
<link href="/lib/jsoneditor/css/jsoneditor.min.css" rel="stylesheet"/>
<script src="/lib/jsoneditor/js/jsoneditor.min.js"></script>
<script src="/script/tool/dubbo.js"></script>
<script src="/script/tool/jsonEditorUtil.js"></script>
    <form method="post" action="/component/saveComponent" class="form-horizontal">
        <div class="form-group">
            <label class="col-md-2 control-label">zookeeper地址：</label>
            <div class="col-md-5">
                <input id="zkAddress" type="text" name="zkAddress" class="form-control" value="${zkAddress!}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-2 control-label">组件别名：</label>
            <div class="col-md-5">
                <input id="interfaceAliasName" type="text" name="interfaceAliasName" class="form-control" value="${interfaceAliasName!}" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-2 control-label">接口名称：</label>
            <div class="col-md-5">
                <input id="interfaceName" type="text"  name="interfaceName" class="form-control" value="${interfaceName!}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-2 control-label">ip端口：</label>
            <div class="col-md-5">
                <#if ip??>
                    <select id="ip" type="text"  name="ip"  class="selectpicker show-tick form-control" data-live-search="true">
                        <option value="${ip!}">${ip!}</option>
                    </select>
                <#else >
                    <select id="ip" type="text"  name="ip"  class="selectpicker show-tick form-control" data-live-search="true">
                    </select>
                </#if>
            </div>
        </div>
        <div class="form-group">
            <label class="col-md-2 control-label">方法名：</label>
            <div class="col-md-5">
                <#if interfaceMethod??>
                    <select id="interfaceMethod" type="text" name="interfaceMethod"  class="selectpicker show-tick form-control"
                            data-live-search="true" onchange="componentMethodParam()">
                        <option value="${interfaceMethod!}">${interfaceMethod!}</option>
                    </select>
                    <#else >
                    <select id="interfaceMethod" type="text" name="interfaceMethod"  class="selectpicker show-tick form-control"
                            data-live-search="true" onchange="componentMethodParam()">
                    </select>
                </#if>

            </div>
        </div>
        <div class="row">
            <div class="col-md-12" class="form-group">
                <div class="col-md-1 control-label">
                    <label>编码:</label>
                </div>
                <div class="col-md-1  control-label">
                    <select id="encoding"  name="encoding"  class="form-control">
                        <option value="UTF-8" <#if encoding?? && encoding="UTF-8"> selected</#if> >UTF-8</option>
                        <option value="GBK"   <#if encoding?? && encoding="GBK"> selected</#if>>GBK</option>
                    </select>
                </div>
                <div class="col-md-1 control-label">
                    <label>超时(秒):</label>
                </div>
                <div class="col-md-1 control-label">
                    <select id="timeout"   name="timeout" class="form-control">
                        <option value="1000" <#if timeout?? && timeout=1000> selected</#if> >1</option>
                        <option value="2000" <#if timeout?? && timeout=2000> selected</#if>>2</option>
                        <option value="3000" <#if timeout?? && timeout=3000> selected</#if>>3</option>
                        <option value="4000" <#if timeout?? && timeout=4000> selected</#if>>4</option>
                        <option value="5000" <#if timeout?? && timeout=5000> selected</#if>>5</option>
                        <option value="6000" <#if timeout?? && timeout=6000> selected</#if>>6</option>
                        <option value="7000" <#if timeout?? && timeout=7000> selected</#if>>7</option>
                        <option value="8000" <#if timeout?? && timeout=8000> selected</#if>>8</option>
                        <option value="9000" <#if timeout?? && timeout=9000> selected</#if>>9</option>
                        <option value="10000" <#if timeout?? && timeout=10000> selected</#if>>10</option>
                    </select>
                </div>
                <input type="hidden" name="id" value="${id!}" >
                <input type="hidden" name="interfaceType" value="${interfaceType!}">
                <input type="hidden" id="param" name="param" value="${param!}">
                <input type="button" onclick="resolveIp()" value="解析ip" class="btn btn-primary">
                <input type="button" onclick="componentResolveMethod()" value="解析方法" class="btn btn-primary">
                <input type="submit" value="保存" class="btn btn-primary">
            </div>
        </div>
    </form>
</@body>